// 定义一个double类型的列表，长度是8，求数组中所有数的积
import scala.io.StdIn

object DoubleListProductWithInput {
  def main(args: Array[String]): Unit = {
    var doubleList = List.empty[Double]
    println("请输入 8 个 Double 类型的数：")
    for (_ <- 1 to 8) {
      val num = StdIn.readDouble()
      doubleList = doubleList :+ num
    }
    val product = doubleList.product
    println(s"列表中所有数的积是: $product")
  }
}